<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>PowerVR SDK</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
<link href="tabs.css" rel="stylesheet" type="text/css">
<table width="100%">
  <tr>
    <td width="33%">
      <p align="left">&nbsp;<a href="http://www.imgtec.com"><img border="0" src="IMGLogo.jpg" width="200" height="30"></a></p>
    </td>
    <td width="33%">
      <p align="center"><font color="#808080" face="Arial" size="2">PowerVR Software Development Kit</a></font></p>
    </td>
    <td width="34%">
      <p align="right"><a href="http://www.powervr.com"><img border="0" src="PVRlogo.jpg" width="200" height="27"></a></p>
    </td>
  </tr>
</table>
<hr>
</head><body>
<!-- Generated by Doxygen 1.3.6 -->
<div class="qindex"><a class="qindex" href="index.html">Main&nbsp;Page</a> | <a class="qindex" href="hierarchy.html">Class&nbsp;Hierarchy</a> | <a class="qindex" href="annotated.html">Class&nbsp;List</a> | <a class="qindex" href="files.html">File&nbsp;List</a> | <a class="qindex" href="functions.html">Class&nbsp;Members</a> | <a class="qindex" href="globals.html">File&nbsp;Members</a></div>
<h1>PVRTResourceFile.h</h1><a href="PVRTResourceFile_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre>00001 <span class="comment">/******************************************************************************</span>
00002 <span class="comment"></span>
00003 <span class="comment"> @File         PVRTResourceFile.h</span>
00004 <span class="comment"></span>
00005 <span class="comment"> @Title        PVRTResourceFile</span>
00006 <span class="comment"></span>
00007 <span class="comment"> @Version      </span>
00008 <span class="comment"></span>
00009 <span class="comment"> @Copyright    Copyright (C)  Imagination Technologies Limited.</span>
00010 <span class="comment"></span>
00011 <span class="comment"> @Platform     ANSI compatible</span>
00012 <span class="comment"></span>
00013 <span class="comment"> @Description  Simple resource file wrapper</span>
00014 <span class="comment"></span>
00015 <span class="comment">******************************************************************************/</span>
00016 <span class="preprocessor">#ifndef _PVRTRESOURCEFILE_H_</span>
00017 <span class="preprocessor"></span><span class="preprocessor">#define _PVRTRESOURCEFILE_H_</span>
00018 <span class="preprocessor"></span>
00019 <span class="preprocessor">#include &lt;stdlib.h&gt;</span>
00020 <span class="preprocessor">#include "<a class="code" href="PVRTString_8h.html">PVRTString.h</a>"</span>
00021 
00022 <span class="comment">/*!***************************************************************************</span>
00023 <span class="comment"> @Class CPVRTResourceFile</span>
00024 <span class="comment"> @Brief Simple resource file wrapper</span>
00025 <span class="comment">*****************************************************************************/</span>
<a name="l00026"></a><a class="code" href="classCPVRTResourceFile.html">00026</a> <span class="keyword">class </span><a class="code" href="classCPVRTResourceFile.html">CPVRTResourceFile</a>
00027 {
00028 <span class="keyword">public</span>:
00029     <span class="comment">/*!***************************************************************************</span>
00030 <span class="comment">    @Function           SetReadPath</span>
00031 <span class="comment">    @Input              pszReadPath The path where you would like to read from</span>
00032 <span class="comment">    @Description        Sets the read path</span>
00033 <span class="comment">    *****************************************************************************/</span>
00034     <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="classCPVRTResourceFile.html#e0">SetReadPath</a>(<span class="keyword">const</span> <span class="keywordtype">char</span>* pszReadPath);
00035 
00036     <span class="comment">/*!***************************************************************************</span>
00037 <span class="comment">    @Function           GetReadPath</span>
00038 <span class="comment">    @Returns            The currently set read path</span>
00039 <span class="comment">    @Description        Returns the currently set read path</span>
00040 <span class="comment">    *****************************************************************************/</span>
00041     <span class="keyword">static</span> <a class="code" href="classCPVRTString.html">CPVRTString</a> <a class="code" href="classCPVRTResourceFile.html#e1">GetReadPath</a>();
00042 
00043     <span class="comment">/*!***************************************************************************</span>
00044 <span class="comment">    @Function           CPVRTResourceFile</span>
00045 <span class="comment">    @Input              pszFilename Name of the file you would like to open</span>
00046 <span class="comment">    @Description        Constructor</span>
00047 <span class="comment">    *****************************************************************************/</span>
00048     <a class="code" href="classCPVRTResourceFile.html#a0">CPVRTResourceFile</a>(<span class="keyword">const</span> <span class="keywordtype">char</span>* pszFilename);
00049 
00050     <span class="comment">/*!***************************************************************************</span>
00051 <span class="comment">    @Function           CPVRTResourceFile</span>
00052 <span class="comment">    @Input              pData A pointer to the data you would like to use</span>
00053 <span class="comment">    @Input              i32Size The size of the data</span>
00054 <span class="comment">    @Description        Constructor</span>
00055 <span class="comment">    *****************************************************************************/</span>
00056     <a class="code" href="classCPVRTResourceFile.html#a0">CPVRTResourceFile</a>(<span class="keyword">const</span> <span class="keywordtype">char</span>* pData, size_t i32Size);
00057 
00058     <span class="comment">/*!***************************************************************************</span>
00059 <span class="comment">    @Function           ~CPVRTResourceFile</span>
00060 <span class="comment">    @Description        Destructor</span>
00061 <span class="comment">    *****************************************************************************/</span>
00062     <span class="keyword">virtual</span> <a class="code" href="classCPVRTResourceFile.html#a2">~CPVRTResourceFile</a>();
00063 
00064     <span class="comment">/*!***************************************************************************</span>
00065 <span class="comment">    @Function           IsOpen</span>
00066 <span class="comment">    @Returns            true if the file is open</span>
00067 <span class="comment">    @Description        Is the file open</span>
00068 <span class="comment">    *****************************************************************************/</span>
00069     <span class="keywordtype">bool</span> <a class="code" href="classCPVRTResourceFile.html#a3">IsOpen</a>() <span class="keyword">const</span>;
00070 
00071     <span class="comment">/*!***************************************************************************</span>
00072 <span class="comment">    @Function           IsMemoryFile</span>
00073 <span class="comment">    @Returns            true if the file was opened from memory</span>
00074 <span class="comment">    @Description        Was the file opened from memory</span>
00075 <span class="comment">    *****************************************************************************/</span>
00076     <span class="keywordtype">bool</span> <a class="code" href="classCPVRTResourceFile.html#a4">IsMemoryFile</a>() <span class="keyword">const</span>;
00077 
00078     <span class="comment">/*!***************************************************************************</span>
00079 <span class="comment">    @Function           Size</span>
00080 <span class="comment">    @Returns            The size of the opened file</span>
00081 <span class="comment">    @Description        Returns the size of the opened file</span>
00082 <span class="comment">    *****************************************************************************/</span>
00083     size_t <a class="code" href="classCPVRTResourceFile.html#a5">Size</a>() <span class="keyword">const</span>;
00084 
00085     <span class="comment">/*!***************************************************************************</span>
00086 <span class="comment">    @Function           DataPtr</span>
00087 <span class="comment">    @Returns            A pointer to the file data</span>
00088 <span class="comment">    @Description        Returns a pointer to the file data</span>
00089 <span class="comment">    *****************************************************************************/</span>
00090     <span class="keyword">const</span> <span class="keywordtype">void</span>* <a class="code" href="classCPVRTResourceFile.html#a6">DataPtr</a>() <span class="keyword">const</span>;
00091 
00092     <span class="comment">/*!***************************************************************************</span>
00093 <span class="comment">    @Function           StringPtr</span>
00094 <span class="comment">    @Returns            The file data as a string</span>
00095 <span class="comment">    @Description        Returns the file as a null-terminated string</span>
00096 <span class="comment">    *****************************************************************************/</span>
00097     <span class="comment">// convenience getter. Also makes it clear that you get a null-terminated buffer.</span>
00098     <span class="keyword">const</span> <span class="keywordtype">char</span>* <a class="code" href="classCPVRTResourceFile.html#a7">StringPtr</a>() <span class="keyword">const</span>;
00099 
00100     <span class="comment">/*!***************************************************************************</span>
00101 <span class="comment">    @Function           Close</span>
00102 <span class="comment">    @Description        Closes the file</span>
00103 <span class="comment">    *****************************************************************************/</span>
00104     <span class="keywordtype">void</span> <a class="code" href="classCPVRTResourceFile.html#a8">Close</a>();
00105 
00106 <span class="keyword">protected</span>:
00107     <span class="keywordtype">bool</span> <a class="code" href="classCPVRTResourceFile.html#p0">m_bOpen</a>;
00108     <span class="keywordtype">bool</span> <a class="code" href="classCPVRTResourceFile.html#p1">m_bMemoryFile</a>;
00109     size_t <a class="code" href="classCPVRTResourceFile.html#p2">m_Size</a>;
00110     <span class="keyword">const</span> <span class="keywordtype">char</span>* <a class="code" href="classCPVRTResourceFile.html#p3">m_pData</a>;
00111 
00112     <span class="keyword">static</span> <a class="code" href="classCPVRTString.html">CPVRTString</a> <a class="code" href="classCPVRTResourceFile.html#t0">s_ReadPath</a>;
00113 };
00114 
00115 <span class="preprocessor">#endif // _PVRTRESOURCEFILE_H_</span>
00116 <span class="preprocessor"></span>
00117 <span class="comment">/*****************************************************************************</span>
<a name="l00118"></a><a class="code" href="classCPVRTResourceFile.html#p0">00118</a> <span class="comment"> End of file (PVRTResourceFile.h)</span>
<a name="l00119"></a><a class="code" href="classCPVRTResourceFile.html#p1">00119</a> <span class="comment">*****************************************************************************/</span>
<a name="l00120"></a><a class="code" href="classCPVRTResourceFile.html#p2">00120</a> 
</pre></div><br>
<br>
<P align=left><FONT size=2><STRONG><A 
   href="http://www.imgtec.com/powervr/insider/legal/index.asp">Copyright</A> � 
   1999-2008, Imagination Technologies Ltd.</STRONG></FONT></P>
<hr>
<address style="align: left;"><small><FONT color=f0f>
Generated by <a href="http://www.doxygen.org/index.html">DOXYGEN</a> 1.3.6</small></address>
</body>
</html>
